package koneksi;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

public class CreateTableBarang {
    public static void main(String[] args) {
        try {
            Connection conn = Koneksi.open();
            Statement state = conn.createStatement();
          //  String sql1 = "create table datauser(username varchar(20), " + " password varchar(50))";
            String query = "create table data_barang(no_barang varchar(20) constraint data_barang_pk primary key,"
                    + "berat_barang varchar(20),"
                    + "jumlah_barang varchar(20),"
                    + "jenis_barang varchar(20),"
                    + "biaya_kirim varchar(20))";
            state.executeUpdate(query);
            System.out.println("tabel data barang is created");
        } catch (SQLException ex) {
            Logger.getLogger(CreateTableBarang.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
